package flux;

import java.util.*;

import article.Article;


public  class Flux {
	
	private String urlFlux;
	private List<Article> listArticles;

	
	
	public Flux(String urlFlux) {
		this.urlFlux = urlFlux;
		this.listArticles = new ArrayList<Article>();
	}

	public List<Article> getListArticles() {
		return listArticles;
	}

	public void setListArticles(List<Article> listArticles) {
		this.listArticles = listArticles;
	}

	public String getUrlFlux() {
		return urlFlux;
	}

	public void setUrlFlux(String urlFlux) {
		this.urlFlux = urlFlux;
	}
	
	public Flux determineFlux(){
		String debutSource = this.urlFlux.substring(0, 2);
		if(debutSource.equals("C:")){
			return new FluxRepertoire(this.urlFlux);
		}
		else{
			return new FluxURL(this.urlFlux);
		}
	}
	
	
	
	@Override
	public String toString() {
		return this.urlFlux;
	}

	/**
	 * 
	 * @param motCle
	 * Methode abstraite de recherche de mot cle. Depend du type de flux
	 */
	public void rechercherMotCle(String motCle){}
	
	
	
		
	
}
